package it.demo;

import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

import java.util.ArrayList;

/**
 * @author ChinaManor
 * #Description Demo
 * #Date: 16/6/2021 09:33
 */
public class Demo {
    public static void main(String[] args) throws Exception {
     //1.构建流环境
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
     //2.
            //2.1添加元素
        env.fromElements("hello","scala","hello scala","hello flink");

            //2.2添加集合
        ArrayList<String> strings = new ArrayList<>();
        strings.add("hello ");
        strings.add("hello world");
        env.fromSequence(1,2);
//        env.read
//        env.readFile()
//        env.addSource()
        //2.3添加序列
//        env.fromParallelCollection()

        env.execute();
    }
}
